package com.ohos.connect.devicecloud.iot.modular.device.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ohos.connect.devicecloud.iot.model.dto.*;
import com.ohos.connect.devicecloud.iot.model.dto.deviceactive.DeviceActiveDTO;
import com.ohos.connect.devicecloud.iot.model.dto.deviceinfosync.DeviceInfoSyncDTO;
import com.ohos.connect.devicecloud.iot.model.vo.*;
import com.ohos.connect.devicecloud.iot.model.vo.deviceactive.DeviceActiveVO;
import com.ohos.connect.devicecloud.iot.modular.device.model.dto.*;
import com.ohos.connect.devicecloud.iot.modular.device.model.entity.Device;
import com.ohos.connect.devicecloud.iot.modular.device.model.param.DeviceAddParam;
import com.ohos.connect.devicecloud.iot.modular.device.model.param.DeviceEditParam;
import com.ohos.connect.devicecloud.iot.modular.device.model.param.DeviceIdParam;
import com.ohos.connect.devicecloud.iot.modular.device.model.vo.DeviceRegisterCodeVO;
import com.ohos.connect.devicecloud.iot.modular.device.model.vo.DeviceRegisterInfoVO;
import com.ohos.connect.devicecloud.iot.modular.device.model.vo.shadowdata.DeviceShadowDataVO;

import java.util.List;

/**
 * 设备表Service接口
 *
 * @author Dongtao
 * @date 2024/12/17 10:43
 **/
public interface DeviceService extends IService<Device> {

    // 获取设备注册验证码
    DeviceRegisterCodeVO getRegisterAuthCode(DeviceRegisterCodeDTO deviceRegisterCodeDTO);

    // 获取设备激活状态
    Boolean getDeviceActiveStatus(String projectId, String devId);

    // APP代理注册设备
    DeviceRegisterInfoVO appRegisterDevice(DeviceRegisterInfoInsertDTO deviceRegisterInfoInsertDTO);

    // 修改设备名称
    Boolean changeDeviceName(String projectId, String deviceId, DeviceNameUpdateDTO deviceNameUpdateDTO);

    // 删除设备
    Boolean deleteDevice(String projectId, String deviceId);

    // APP控制设备
    Boolean deviceControl(DeviceControlDTO deviceControlDTO);

    Boolean RestoreFactory(DeviceControlDTO deviceControlDTO);

    // 批量获取设备本地控制码
    List<DeviceAuthCodeVO> getDeviceAuthCodeList(List<DeviceAuthCodeDTO> deviceAuthCodeDTOList);

    // 获取设备快照数据
    DeviceShadowDataVO getDeviceShadowData(DeviceShadeDataGetDTO deviceShadeDataGetDTO);

    // 获取设备所有快照数据
    String getDeviceAllShadowData(DeviceShadeDataGetDTO deviceShadeDataGetDTO);
    // =======================================================> to coap

    // 交换设备与云端sn,设备上传sn1，云端返回sn2
    DevicePskVO exchangeDeviceSn(DevicePskDTO devicePskDTO);

    // 设备激活
    DeviceActiveVO activeDevice(DeviceActiveDTO deviceActiveDTO);

    // 设备登录
    DeviceLoginVO loginDevice(DeviceLoginDTO deviceLoginDTO);

    // 设备信息同步
    DeviceInfoSyncVO syncDeviceInfo(List<DeviceInfoSyncDTO> deviceInfoSyncDTOList);

    // 设备数据上报
    DeviceDataVO deviceDataUpload(List<DeviceDataInfoDTO> deviceDataInfoDTOList);

    // 设备所有快照数据上报
    DeviceDataVO deviceAllShadowDataUpload(List<DeviceNetInfoDTO> deviceDataInfoDTOList);

    DeviceDataVO deviceNetInfoDataUpload(List<DeviceNetInfoDTO> deviceDataInfoDTOList);

    DeviceDataVO deviceControlReturn(DeviceControlDataDTO deviceControlDataDTO);

    // 注销设备
    DeviceRevokeVO deviceRevoke(DeviceRevokeDTO deviceRevokeDTO);

    // 获取设备认证码
    DeviceAuthCodeVO deviceAuthCode(DeviceAuthCodeDTO deviceAuthCodeDTO);

    //桥下挂设备状态同步
    List<DeviceStatusSyncVO> deviceStatusSync(List<DeviceStatusSyncDTO> deviceStatusSyncDTOList);

    //燃气泄漏信息上报
    DeviceLeakReportVO deviceLeakReport(DeviceLeakReportDTO deviceLeakReportDTO);

    // 设备心跳
    DeviceHeartBeatVO deviceHeartBeat(DeviceHeartBeatDTO deviceHeartBeatDTO);

    // 根据设备id列表，批量获取设备
    List<DeviceInfoVO> getDeviceInfoList(List<String> deviceIdList);

    // 根据设备id获取设备信息
    DeviceInfoVO getDeviceInfoById(String deviceId);


    /**
     * 添加设备表
     *
     * @author Dongtao
     * @date 2024/12/17 10:43
     */
    String add(DeviceAddParam deviceAddParam);

    /**
     * 编辑设备表
     *
     * @author Dongtao
     * @date 2024/12/17 10:43
     */
    void edit(DeviceEditParam deviceEditParam);

    /**
     * 删除设备表
     *
     * @author Dongtao
     * @date 2024/12/17 10:43
     */
    void delete(List<DeviceIdParam> deviceIdParamList);

    /**
     * 获取设备表详情
     *
     * @author Dongtao
     * @date 2024/12/17 10:43
     */
    String detail(DeviceControlDTO deviceControlDTO);

    /**
     * 获取设备表详情
     *
     * @author Dongtao
     * @date 2024/12/17 10:43
     **/
    Device queryEntity(String id);
}
